package test;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.zhang.action.PhoneAction;
import config.Config;

public class Demo {

	@Test
	public void test(){
		
		ApplicationContext context = new 
				AnnotationConfigApplicationContext(Config.class);
		PhoneAction phoneAction = (PhoneAction) context.getBean("phoneAction");
		phoneAction.execute();
		
	}
	
	@Test
	public void test2(){
		
		ApplicationContext context = new 
				ClassPathXmlApplicationContext("spring.xml");
		PhoneAction phoneAction = (PhoneAction) context.getBean("phoneAction");
		phoneAction.execute();
		
	}
}
